<template>
    <el-dialog :visible.sync="showAddModal" :append-to-body="true"
               :close-on-click-modal="false" width="50%"
               :close-on-press-escape="false" :show-close="false" class="ele-modal"
               :modal-append-to-body='false'>
        <h4 slot="title" v-if="!$isNullObj(data.user)">{{data.user.nickname}}</h4>
        <div class="product-detail-modal">
            <div class="approve-detail-modal-title">
                <h2>团长详情</h2>
            </div>
            <ul class="bill-tips clearfix">
                <li style="width: 15%;">
                    <img style="height: 80px;width: 80px;margin-bottom: 6px;margin-top: 6px;float: left;" v-if="!$isNullObj(data.user)"
                         :src="data.user.avatarUrl" class="image">
                </li>
            </ul>

            <div>
                <h3 class="panel-title">经销商信息 </h3>
            </div>
            <el-row>
                <ul class="bill-tips clearfix">
                    <li>
                        <em>地址</em>
                        <span>{{data.address}}</span>
                    </li>
                    <li>
                        <em>经销商名称</em>
                        <span>{{data.storeName}}</span>
                    </li>
                    <!--<li>-->
                    <!--<em>用户类型</em>-->
                    <!--<span v-if="data.userType === 1">普通用户</span>-->
                    <!--<span v-if="data.userType === 2">团长</span>-->
                    <!--</li>-->
                </ul>
            </el-row>
            <div>
                <h3 class="panel-title">基本信息 </h3>
            </div>
            <el-row>
                <ul class="bill-tips clearfix">
                    <li>
                        <em>团长昵称</em>
                        <span v-if="!$isNullObj(data.user)">{{data.user.nickname}}</span>
                    </li>
                    <li>
                        <em>团长姓名</em>
                        <span v-if="!$isNullObj(data.user)">{{data.user.realName}}</span>
                    </li>
                    <!--<li>-->
                        <!--<em>用户类型</em>-->
                        <!--<span v-if="data.userType === 1">普通用户</span>-->
                        <!--<span v-if="data.userType === 2">团长</span>-->
                    <!--</li>-->
                </ul>
            </el-row>
            <div>
                <h3 class="panel-title">联系方式</h3>
            </div>
            <ul class="bill-tips clearfix">
                <li>
                    <em>手机号</em>
                    <span v-if="!$isNullObj(data.user)">{{data.user.mobile}}</span>
                </li>
            </ul>
            <div>
                <h3 class="panel-title">其他 </h3>
            </div>
            <ul class="bill-tips clearfix">
                <li>
                    <em>性别</em>
                    <span v-if="!$isNullObj(data.user) && data.user.gender === '1'">女</span>
                    <span v-if="!$isNullObj(data.user) && data.user.gender === '0'">男</span>
                    <span v-if="!$isNullObj(data.user) && data.user.gender === '2'">男</span>
                </li>
                <li>
                    <em>创建日期</em>
                    <span>{{data.createTime}}</span>
                </li>
            </ul>
        </div>
        <div slot="footer" class="row" style="text-align: right;margin-right: 5px;">
            <a class="revision-btn" href="javaScript:void(0)" @click="onCancel">确 定</a>
        </div>
    </el-dialog>
</template>

<script>

    export default {
        name: "viewCustomerModal",
        props: {
            showAddModal: {
                type: Boolean,
                default: false
            },
            CustomersId: {
                type: String,
                default: ''
            }
        },
        data() {
            return {
                modalLabel: '客户详情',
                newForm: {
                    avatarUrl: '',
                    nickname: '',
                    realName: '',
                    userType: '',
                    mobile: '',
                    gender: '',
                    createTime: '',
                },
                formLabelWidth: '100px',
                data: {}
            }
        },
        mounted: function () {
        },
        methods: {
            onCancel() {
                this.$emit('onCancelNewModal');
                this.data = {};
            },
            async getInfo(id) {
                let res = await this.$api.get('/mall/store/info/' + id, {});
                if (res.code === 0) {
                        this.data = res.store;
                } else {
                    this.$message.error(res.msg);
                }
            },
        }
    }
</script>

<style scoped>
    .product-detail-modal {
        font-family: "open sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
        font-size: 12px;
        color: #676a6c;
    }

    .ele-modal /deep/ .el-dialog__header {
        border-bottom: 1px solid #e5e5e5;
        padding: 5px 0 2px 15px !important;
    }

    .ele-modal /deep/ .el-dialog__body {
        padding: 0 20px 30px 20px;
    }

    .ele-modal /deep/ .el-dialog__footer {
        border-top: 1px solid #e5e5e5;
        padding: 15px;
    }

</style>
